<?php
class UserPsytest extends CActiveRecord {
	
	public static function model($className = __CLASS__) {
		return parent::model($className);
	}

	public function tableName() {
		return strtolower('UserPsytest');
	}
	
	public function relations() {
		return array(
			'topic' => array(self::BELONGS_TO, 'TestTopics', 'topicId',
				'joinType' => 'INNER JOIN'
			)
		);
	}
	
	public function rules() {
		return array(
		);
	}

    public function getConclusionIds() {
        return explode(',', $this->conclusionIds);
    }

    public function setConclusionIds($ids) {
        $this->conclusionIds = join(',', $ids);
    }

    public function setState($state) {
        $this->state = addslashes(serialize($state));
    }

    public function getState() {
        return unserialize(stripslashes($this->state));
    }
}
